<template>
  <div :class="index===selectIndex?'menu_item_container_active':'menu_item_container'"
  @click="onClick">
    {{item.cname}}
  </div>
</template>

<script>
export default {
  props:{
    item:Object,
    selectIndex:Number,
    index:Number
  },
  methods:{
    onClick(){
      this.$emit("changeMenu",this.index);
    }
  }
}
</script>

<style scoped>
.menu_item_container
{
  width: 100%;
  height: 50px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  color: #333;
}

.menu_item_container_active
{
  width: 100%;
  height: 50px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  color: red;
  border: 1px solid  red;
}
</style>